<?php

/**
 * This is the model class for table "zy_dnslist".
 *
 * The followings are the available columns in table 'zy_dnslist':
 * @property integer $dnslist_id
 * @property integer $user_id
 * @property string $dns1
 * @property string $dns2
 * @property string $dns3
 * @property string $dns4
 * @property string $dnslist_remark
 * @property integer $is_delete
 * @property string $create_user
 * @property string $create_time
 * @property string $update_user
 * @property string $update_time
 */
class DnsList extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return DnsList the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'zy_dnslist';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('user_id, is_delete', 'numerical', 'integerOnly'=>true),
			array('dns1, dns2, dns3, dns4, dnslist_remark', 'length', 'max'=>255),
			array('create_user, update_user', 'length', 'max'=>50),
			array('create_time, update_time', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('dnslist_id, user_id, dns1, dns2, dns3, dns4, dnslist_remark, is_delete, create_user, create_time, update_user, update_time', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'dnslist_id' => 'Dnslist',
			'user_id' => 'User',
			'dns1' => 'Dns1',
			'dns2' => 'Dns2',
			'dns3' => 'Dns3',
			'dns4' => 'Dns4',
			'dnslist_remark' => 'Dnslist Remark',
			'is_delete' => 'Is Delete',
			'create_user' => 'Create User',
			'create_time' => 'Create Time',
			'update_user' => 'Update User',
			'update_time' => 'Update Time',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('dnslist_id',$this->dnslist_id);
		$criteria->compare('user_id',$this->user_id);
		$criteria->compare('dns1',$this->dns1,true);
		$criteria->compare('dns2',$this->dns2,true);
		$criteria->compare('dns3',$this->dns3,true);
		$criteria->compare('dns4',$this->dns4,true);
		$criteria->compare('dnslist_remark',$this->dnslist_remark,true);
		$criteria->compare('is_delete',$this->is_delete);
		$criteria->compare('create_user',$this->create_user,true);
		$criteria->compare('create_time',$this->create_time,true);
		$criteria->compare('update_user',$this->update_user,true);
		$criteria->compare('update_time',$this->update_time,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}